home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_07 / plauger / istream.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-03  |  566 b   |  31 lines

  1. // istream -- istream basic members
  2. #include <ctype.h>
  3. #include <istream>
  4. #include <ostream>
  5.  
  6. istream::~istream()
  7.     {    // destruct an istream -- DO NOTHING
  8.     }
  9.  
  10. _Bool istream::ipfx(int noskip)
  11.     {    // setup for input
  12.     if (good())
  13.         {    // no errors, flush and skip
  14.         if (tie() != 0)
  15.             tie()->flush();
  16.         if (!noskip && flags() & skipws)
  17.             {    // skip white space
  18.             int ch;
  19.             while (isspace(ch = rdbuf()->sbumpc()))
  20.                 ;
  21.             if (ch != EOF)
  22.                 rdbuf()->sputbackc(ch);
  23.             }
  24.         if (good())
  25.             return (1);
  26.         }
  27.     setstate(failbit);
  28.     return (0);
  29.     }
  30.  
  31.